﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Flagwind.Collections;

namespace Flagwind.Data
{
	// 临时方案
	public class DataAccessSettings
	{
		#region 成员字段

		private bool _enableLog;
		private long _executeTime;
		private NamedCollection<IDataProvider> _dataProviders;

		#endregion

		#region 静态属性

		private static DataAccessSettings _default;

		public static DataAccessSettings Default
		{
			get
			{
				if(_default == null)
				{
					_default = new DataAccessSettings();
					_default.EnableLog = true;
					_default.ExecuteTime = 0;
//					Flagwind.Options.OptionManager.Default.GetOptionObject()
				}

				return _default;
			}
			set
			{
				_default = value;
			}
		}

		#endregion

		#region 公共属性

		public bool EnableLog
		{
			get
			{
				return _enableLog;
			}
			set
			{
				_enableLog = value;
			}
		}

		public long ExecuteTime
		{
			get
			{
				return _executeTime;
			}
			set
			{
				_executeTime = value;
			}
		}

		public NamedCollection<IDataProvider> DataProviders
		{
			get
			{
				return _dataProviders;
			}
			set
			{
				_dataProviders = value;
			}
		}

		#endregion
	}
}
